package com.fishbone.sso.service.impl;

import com.fishbone.sso.entity.MetaResource;
import com.fishbone.sso.service.MetaResourceService;
import lombok.AllArgsConstructor;
import org.springframework.web.client.RestTemplate;

import java.util.HashSet;
import java.util.Set;

@AllArgsConstructor
public class DefaultMetaResourceService implements MetaResourceService {

    private final RestTemplate restTemplate;

    @Override
    public Set<MetaResource> queryPatternsAndMethods() {

        Set<MetaResource> metaResources = new HashSet<>();

        MetaResource e = new MetaResource();
        e.setPattern("/foo/param/*");
        e.setMethod("GET");
        metaResources.add(e);
        MetaResource m = new MetaResource();
        m.setPattern("/foo/prefilter");
        m.setMethod("POST");
        metaResources.add(m);
        MetaResource f = new MetaResource();
        f.setPattern("/client1/say");
        f.setMethod("GET");
        metaResources.add(f);
        MetaResource g = new MetaResource();
        g.setPattern("/client2/say");
        g.setMethod("GET");
        metaResources.add(g);
        return metaResources;
    }
}
